package com.hyfrogx.modules.manage.controller;

import com.hyfrogx.common.param.JSONResult;
import com.hyfrogx.common.utils.QueryExt;
import com.hyfrogx.common.utils.R;
import com.hyfrogx.modules.manage.service.HyVideoSmallCommentService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

@RestController
@RequestMapping("/smallVideo/comment")
@Api(value = "小视频评论controller", tags = {"后台-小视频评论"})
public class HyVideoSmallCommentController extends BaseController {

    @Autowired
    private HyVideoSmallCommentService hyVideoSmallCommentService;

    /**
     * 查看小视频评论
     */
    @PostMapping("/list/{id}")
    public R list(@PathVariable Integer id, @RequestBody Map<String,Object> params) {
        return R.ok().put("data",hyVideoSmallCommentService.getCommentsById(new QueryExt(params),id));
    }

    /**
     * 删除小视频评论
     */
    @PostMapping("/delete")
    public JSONResult deletewulicommentbyid(Integer id) {
        try {
            hyVideoSmallCommentService.deleteCommentById(id);
            return ajaxSuccess("操作成功");
        } catch (Exception e) {
            return ajaxFail(e.getMessage());
        }
    }




}
